package com.cjc.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cjc.dao.StudentMapper;
import com.cjc.dto.Dto;
import com.cjc.model.Students;


@Controller
@ResponseBody//תjson
@RequestMapping("/stu")
public class StudentManageController {
@Resource
private StudentMapper stu;
@RequestMapping("/findAll.do")
public Map<String, Object>findAll(Dto dto){
	//System.out.println(dto.toString());
	List<Students> list=stu.fandAll(dto);
	int num=stu.count(dto);
	Map<String, Object> map=new HashMap<String, Object>();
	map.put("msg","");
    map.put("code",0);
    map.put("count",num);
    map.put("data",list);
	return map;
}
@RequestMapping("/inser.do")
public int inser(Students s){
	
	return stu.inser(s);
}
}
